home *** CD-ROM | disk | FTP | other *** search
/ Commodore 64 Scene Diskmags Assortment / Commodore_CEE_Vol._1_Issue_05_1995_Jack_Vander_White_Disk_2_of_3_Side_B.d64 / program bit 4 < prev    next >
Text File  |  2023-02-26  |  22KB  |  643 lines

  1. basic / ml
  2.  
  3. From : David Schmoll
  4.  
  5. Jim Brain writes:
  6.  
  7.  JB> I know a lot of us use it, but BASIC encourages some bad programming practics, and ML won't allow you to bring the programming prcatices over. In addition, BASIC is like running, where ML is like taking baby steps.
  8.  
  9. I don't agree at all! Just because you can write unstructured programs in Basic does not mean you have to. I have always written very structured Basic programs and try to do the same thing in ML. Now I tend to structure my Basic with ML in mind, because I use Basic as test code before I code in ML. Anything goes in ML, so actually it is easier to code poorly in ML. Tricks the Kernal uses such as pushing return addresses on the stack and performing an rts, is considered bad form, but I now use that trick as conditions warrant it. I also use bit instructions to skip a byte or two, just like the Kernal does. That goes against how I was taught programming, but real world situations and solutions, sometimes means breaking the rules:) Comparing my style to other programmers though, I'm still very structured. People always want to blame Basic as a poor programming language, when it is actually just the poor programmers. My only complaint with Basic is the speed.
  10.  
  11. --------------------------------
  12. Basic Command List
  13.  
  14. From : jopi@stekt.oulu.fi
  15.  
  16. Mark Rubin <mrubin@gallium.csusb.edu> writes:
  17.     
  18.     Mark> I have a 128 but no manual.  I know there are lots of commands in Basic 7 that aren't in Basic 2 (which I know). Does anybody know where a list of commands might be posted on the net? (or somewhere else?)
  19.  
  20.  
  21.   Ok... this time. The following list includes keywords from all known CBM Basics.
  22.  
  23.   Listed below are keywords and token codes for all CBM Basic versions supported on petcat v1.9. They include the following:
  24.  
  25.         Basic 1.0
  26.         Basic 2.0
  27.         Basic 2.0 with Super Expander
  28.         Basic 2.0 and Simon's Basic
  29.         Basic 2.0 with Speech Basic v2.7
  30.         Basic 4.0
  31.         Basic 4.0 extension for C64
  32.         Basic 3.5
  33.         Basic 7.0
  34.         Basic 10.0
  35.  
  36.  
  37.         COMMODORE BASIC KEYWORDS
  38.  
  39.   Common Keywords (Tokens 80 - CB)
  40.  
  41.   Tokens 80 to A2 represent action keywords, while codes B4 trough CA
  42.   are function keywords. AA - B3 are BASIC operators.
  43.  
  44.   There is no GO (CB) on Basic 1.0.
  45.  
  46.  
  47. Token   Keyword
  48.  
  49. 80      end
  50. 81      for
  51. 82      next
  52. 83      data
  53. 84      input#
  54. 85      input
  55. 86      dim
  56. 87      read
  57. 88      let
  58. 89      goto
  59. 8a      run
  60. 8b      if
  61. 8c      restore
  62. 8d      gosub
  63. 8e      return
  64. 8f      rem
  65. 90      stop
  66. 91      on
  67. 92      wait
  68. 93      load
  69. 94      save
  70. 95      verify
  71. 96      def
  72. 97      poke
  73. 98      print#
  74. 99      print
  75. 9a      cont
  76. 9b      list
  77. 9c      clr
  78. 9d      cmd
  79. 9e      sys
  80. 9f      open
  81. a0      close
  82. a1      get
  83. a2      new
  84. ------------------
  85. a3      tab(
  86. a4      to
  87. a5      fn
  88. a6      spc(
  89. a7      then
  90. a8      not
  91. a9      step
  92. ------------------
  93. aa      +
  94. ab      -
  95. ac      *
  96. ad      /
  97. ae      ^
  98. af      and
  99. b0      or
  100. b1      >
  101. b2      =
  102. b3      <
  103. ------------------
  104. b4      sgn
  105. b5      int
  106. b6      abs
  107. b7      usr
  108. b8      fre
  109. b9      pos
  110. ba      sqr
  111. bb      rnd
  112. bc      log
  113. bd      exp
  114. be      cos
  115. bf      sin
  116. c0      tan
  117. c1      atn
  118. c2      peek
  119. c3      len
  120. c4      str$
  121. c5      val
  122. c6      asc
  123. c7      chr$
  124. c8      left$
  125. c9      right$
  126. ca      mid$
  127. ------------------
  128. cb      go      (Basic 2.0 and higher only)
  129. ff      pi
  130.  
  131.   Extension Keywords (Tokens CC - FE)
  132.  
  133. The following codes are defined differently in each Basic version. The leftmost column shows VIC Super Expander commands (CC trough DD). Basic 3.5 and 7.0 differ in codes CE and FE, which are prefixes in 7.0, whereas in 3.5 CE = rlum and FE is unused.
  134.  
  135. Codes CC to D4 (3.5, 7.0 and 10.0) are function keywords, and D5 trough FA are action keywords.
  136.  
  137.  
  138. Token   Keyword
  139.         2.0 Super       4.0             3.5/7.0         10.0
  140.  
  141. cc      key             concat          rgr             rgr  2)
  142. cd      graphic         dopen           rclr            rclr 2)
  143. ce      scnclr          dclose          rlum/*prefix*   *prefix*
  144. cf      circle          record          joy             joy
  145.  
  146. d0      draw            header          rdot            rdot 2)
  147. d1      region          collect         dec             dec
  148. d2      color           backup          hex$            hex$
  149. d3      point           copy            err$            err$
  150. d4      sound           append          instr           instr
  151. d5      char            dsave           else            else
  152. d6      paint           dload           resume          resume
  153. d7      rpot            catalog         trap            trap
  154.  
  155. d8      rpen            rename          tron            tron
  156. d9      rsnd            scratch         troff           troff
  157. da      rcolr           directory       sound           sound
  158. db      rgr                             vol             vol
  159. dc      rjoy                            auto            auto
  160. dd      rdot                            pudef           pudef
  161. de                                      graphic         graphic
  162. df                                      paint           paint 2)
  163.  
  164. e0                                      char            char
  165. e1                                      box             box
  166. e2                                      circle          circle
  167. e3                                      gshape          paste 2)
  168. e4                                      sshape          cut  2)
  169. e5                                      draw            line
  170. e6                                      locate          locate 2)
  171. e7                                      color           color
  172.  
  173. e8                                      scnclr          scnclr
  174. e9                                      scale           scale 2)
  175. ea                                      help            help
  176. eb                                      do              do
  177. ec                                      loop            loop
  178. ed                                      exit            exit
  179. ee                                      directory       dir
  180. ef                                      dsave           dsave
  181.  
  182. f0                                      dload           dload
  183. f1                                      header          header
  184. f2                                      scratch         scratch
  185. f3                                      collect         collect
  186. f4                                      copy            copy
  187. f5                                      rename          rename
  188. f6                                      backup          backup
  189. f7                                      delete          delete
  190.  
  191. f8                                      renumber        renumber
  192. f9                                      key             key
  193. fa                                      monitor         monitor
  194.                                         --------------------------
  195. fb                                      using           using
  196. fc                                      until           until
  197. fd                                      while           while
  198. fe                                      *prefix*        *prefix*
  199.  
  200.   Prefixed Extension Keywords (Tokens CE02 - CE0A)
  201.  
  202.   The following codes implement function keywords. Basics 7.0 and 10.0 only.
  203.  
  204.  
  205. Token   Keyword
  206.  
  207. ce00
  208. ce01
  209. ce02    pot
  210. ce03    bump
  211. ce04    pen
  212. ce05    rspos
  213. ce06    rsprite
  214. ce07    rspcolor
  215.  
  216. ce08    xor
  217. ce09    rwindow
  218. ce0a    pointer
  219.  
  220.  
  221.  
  222.   Prefixed Extension Keywords (Tokens FE02 - FE26)
  223.  
  224.   The following codes are for 7.0 and 10.0 only. Keywords in the middle are commom.
  225.  
  226.  
  227. Token           Keyword
  228.          7.0               10.0
  229.  
  230. fe00
  231. fe01
  232. fe02            bank
  233. fe03            filter
  234. fe04            play
  235. fe05            tempo
  236. fe06            movspr
  237. fe07            sprite
  238.  
  239. fe08            sprcolor
  240. fe09            rreg
  241. fe0a            envelope
  242. fe0b            sleep
  243. fe0c            catalog
  244. fe0d            dopen
  245. fe0e            append
  246. fe0f            dclose
  247.  
  248. fe10            bsave
  249. fe11            bload
  250. fe12            record
  251. fe13            concat
  252. fe14            dverify
  253. fe15            dclear
  254. fe16            sprsav
  255. fe17            collision
  256.  
  257. fe18            begin
  258. fe19            bend
  259. fe1a            window
  260. fe1b            boot
  261. fe1c            width  2)
  262. fe1d            sprdef 2)
  263. fe1e            quit 1) 2)
  264. fe1f     stash           dma
  265.  
  266. fe20
  267. fe21     fetch           dma
  268. fe22
  269. fe23     swap            dma
  270. fe24            off 1) 2)
  271. fe25            fast
  272. fe26            slow
  273. fe27                     type
  274.  
  275. fe28                     bverify
  276. fe29                     ectory (diRectorY)
  277. fe2a                     erase
  278. fe2b                     find
  279. fe2c                     change
  280. fe2d                     set  3)
  281. fe2e                     screen
  282. fe2f                     polygon
  283.  
  284. fe30                     ellipse
  285. fe31                     viewport 2)
  286. fe32                     gcopy 2)
  287. fe33                     pen
  288. fe34                     palette
  289. fe35                     dmode
  290. fe36                     dpat
  291. fe37                     pic  2)
  292.  
  293. fe38                     genlock
  294. fe39                     foreground
  295. fe3a
  296. fe3b                     background
  297. fe3c                     border
  298. fe3d                     highlight
  299.  
  300.  
  301.  Notes:
  302.   1)    Gives "unimplemented command error" on BASIC 7.0
  303.   2)    Gives "unimplemented command error" on BASIC 10.0 v0.9
  304.   3)    Only 'set def' is implemented.
  305.  
  306.  
  307. ---------------------------------
  308.  
  309.  Third party products for VIC-20
  310.  
  311.  
  312.  Turtle Basic v1.0 Keywords
  313.  
  314. cc      graphic
  315. cd      old
  316. ce      turn
  317. cf      pen
  318.  
  319. d0      draw
  320. d1      move
  321. d2      point
  322. d3      kill
  323. d4      write
  324. d5      repeat
  325. d6      screen
  326. d7      doke
  327.  
  328. d8      reloc
  329. d9      fill
  330. da      rtime
  331. db      base
  332. dc      pause
  333. dd      pop
  334. de      color
  335. df      merge
  336.  
  337. e0      char
  338. e1      take
  339. e2      sound
  340. e3      vol
  341. e4      put
  342. e5      place
  343. e6      cls
  344. e7      accept
  345.  
  346. e8      reset
  347. e9      grab
  348. ea      rdot
  349. eb      plr$
  350. ec      deek
  351. ed      joy
  352.  
  353.  
  354. -------------------------------
  355.  
  356.  Third party products for C=64
  357.  
  358.  
  359.  Simon's Basic Keywords
  360.  
  361. Token   Keyword
  362.  
  363. 6400
  364. 6401    hires
  365. 6402    plot
  366. 6403    line
  367. 6404    block
  368. 6405    fchr
  369. 6406    fcol
  370. 6407    fill
  371.  
  372. 6408    rec
  373. 6409    rot
  374. 640a    draw
  375. 640b    char
  376. 640c    hi col
  377. 640d    inv
  378. 640e    frac
  379. 640f    move
  380.  
  381. 6410    place
  382. 6411    upb
  383. 6412    upw
  384. 6413    leftw
  385. 6414    leftb
  386. 6415    downb
  387. 6416    downw
  388. 6417    rightb
  389.  
  390. 6418    rightw
  391. 6419    multi
  392. 641a    colour
  393. 641b    mmob
  394. 641c    bflash
  395. 641d    mob set
  396. 641e    music
  397. 641f    flash
  398.  
  399. 6420    repeat
  400. 6421    play
  401. 6422    >>
  402. 6423    centre
  403. 6424    envelope
  404. 6425    cgoto
  405. 6426    wave
  406. 6427    fetch
  407.  
  408. 6428    at(
  409. 6429    until
  410. 642a    >>
  411. 642b    >>
  412. 642c    use
  413. 642d    >>
  414. 642e    global
  415. 642f    >>
  416.  
  417. 6430    reset
  418. 6431    proc
  419. 6432    call
  420. 6433    exec
  421. 6434    end proc
  422. 6435    exit
  423. 6436    end loop
  424. 6437    on key
  425.  
  426. 6438    disable
  427. 6439    resume
  428. 643a    loop
  429. 643b    delay
  430. 643c    >>
  431. 643d    >>
  432. 643e    >>
  433. 643f    >>
  434.  
  435. 6440    secure
  436. 6441    disapa
  437. 6442    circle
  438. 6443    on error
  439. 6444    no error
  440. 6445    local
  441. 6446    rcomp
  442. 6447    else
  443.  
  444. 6448    retrace
  445. 6449    trace
  446. 644a    dir
  447. 644b    page
  448. 644c    dump
  449. 644d    find
  450. 644e    option
  451. 644f    auto
  452.  
  453. 6450    old
  454. 6451    joy
  455. 6452    mod
  456. 6453    div
  457. 6454    >>
  458. 6455    dup
  459. 6456    inkey
  460. 6457    inst
  461.  
  462. 6458    test
  463. 6459    lin
  464. 645a    exor
  465. 645b    insert
  466. 645c    pot
  467. 645d    penx
  468. 645e    >>
  469. 645f    peny
  470.  
  471. 6460    sound
  472. 6461    graphics
  473. 6462    design
  474. 6463    rlocmob
  475. 6464    cmob
  476. 6465    bckgnds
  477. 6466    pause
  478. 6467    nrm
  479.  
  480. 6468    mob off
  481. 6469    off
  482. 646a    angl
  483. 646b    arc
  484. 646c    cold
  485. 646d    scrsv
  486. 646e    scrld
  487. 646f    text
  488.  
  489. 6470    cset
  490. 6471    vol
  491. 6472    disk
  492. 6473    hrdcpy
  493. 6474    key
  494. 6475    paint
  495. 6476    low col
  496. 6477    copy
  497.  
  498. 6478    merge
  499. 6479    renumber
  500. 647a    mem
  501. 647b    detect
  502. 647c    check
  503. 647d    display
  504. 647e    err
  505. 647f    out
  506.  
  507.  
  508.  
  509.   Basic 4.0 Expansion for C64 defines codes CC trough DA like 4.0 above, but also a few more:
  510.  
  511. Token   Keyword
  512.  
  513. db      color
  514. dc      cold
  515. dd      key
  516. de      dverify
  517. df      delete
  518. e0      auto
  519. e1      merge
  520. e2      old
  521. e3      monitor
  522.  
  523.  
  524.  
  525.   Speech Basic v2.7  Keywords (Tokens CC - E6)
  526.  
  527. Token   Keyword
  528.  
  529. cc      reset
  530. cd      basic
  531. ce      help
  532. cf      key
  533.  
  534. d0      himem
  535. d1      disk
  536. d2      dir
  537. d3      bload
  538. d4      bsave
  539. d5      map
  540. d6      mem
  541. d7      pause
  542.  
  543. d8      block
  544. d9      hear
  545. da      record
  546. db      play
  547. dc      voldef
  548. dd      coldef
  549. de      hex
  550. df      dez
  551.  
  552. e0      screen
  553. e1      exec
  554. e2      mon
  555. e3      <-
  556. e4      from
  557. e5      speed
  558. e6      off
  559.  
  560.  
  561.  
  562. -----------------------------------
  563. c64 character generator 
  564.  
  565. From : rmcwilson@delphi.com
  566.  
  567. You can adjust WHERE the computer "sees" the image for characters by
  568. changing 2 memory locations:
  569.          
  570. 1) $D018 (53272)  Bits 1,2,3 can represent any even number 0-14.
  571. This number represents the offset from the beginning of block of memory that the VIC chip is addressing. Example, you are using block 1 ($4000-$7fff) and you want your character data at 4K into the block. Set $DD00 to block 1, and then set only bit 2 in $D018. This will force the VIC to "see" the character dot data at 4K + 16384.
  572.  
  573. 2) $DD00 (56576) This memory location selects which of the 4 blocks
  574. (banks) of 16k video memory that the VIC chip addresses. These banks are numbered 0-3. Bits 0 and 1 of this location select this.  You set these bits using this pattern:
  575.       Bank 0= 1 1
  576.       Bank 1= 1 0
  577.       Bank 2= 0 1
  578.       Bank 3= 0 0
  579.  
  580. A nice book which deals with all of this is: Mapping the 64 by Compute books.
  581.  
  582. --------------------------------
  583. Comal
  584.  
  585. From : alan.jones@qcs.org
  586.  
  587.  
  588. Someone asked what is the status of COMAL on the C64.  The truth is "I don't know", but I'll tell you what I do know and think about Comal.  I think Comal is the best programming language for the C64.  I was fortunate to discover Comal shorlty after I bought my C64 and was totaly discusted with Basic.  I was able to follow the Comal
  589. language from Comal Today #1.  It is a good learning language and a great development language.
  590.  
  591. As near as I can tell, Comal is dead, except on my desk and a few others.  Len Lindsay, of the Comal Users Group USA, Ltd. published the Comal Today magazine issues 1-27.  It has been several years since the last issue was published.  Toward the end, Len made the mistake(?) that many in the Commodore community made.  He tried to support the Comal language on other platforms, CP/M, Amiga, IBM PC, etc. to the detriment of C64/128 support.  This was undoubtedly expensive and the loyal C64 users did not carry over to the other machines.  The CP/M Comal was slow, the IBM Comals were too expensive.  The Amiga Comal was pretty good and reasonably priced, but Amiga was not very popular and users had many other languages to choose from.
  592.  
  593. If Commodore USA had embraced Comal the way they embraced GEOS the world would be a better place today.  Comal started in Demark and was more popular in the Danish and Dutch countries.  I would expect it to still be in use over there but there were no replies from my inquirery about Comal on this international newsgroup, except for a few in the USA.
  594.  
  595. I started with Comal 0.14.  This was a free disk loaded version that provided just under 10K of free memory.  It took a long time to load on a stock C64/1541.  Still, I prefered it instantly and I have not programmed in Basic since.  Eventually there were updates that added more commands, fast loaders, and even provided more free memory. The full Comal language was the Comal 2.0 cartridge. This is a Unicomal product and was imported to the USA by the Comal Users Group USA, Ltd. They sold for about $100.  It was 64K of ROM and provided almost 30K of free RAM.  Comal 2.0 suported external procedures (like overlays) and machine language packages.  The packages could be loaded into RAM or put onto ROM or EPROM and installed on the cartridge.  I bought one of the first Comal 2.0 cartridges.  This was a tan or grey cartridge
  596. packed full with 4 16K EPROMS.  These were made in the USA under licence from Unicomal.  They would not hold package extensions.  Later the Black cartridge was available, imported with three 32K sockets.
  597. Two 32K ROMs contained the base Comal 2.0 system.  A 16K "super chip" ROM was developed that contained many packages.  There may have been a jumper for a 16K or 32K ROM or EPROM.  I never had a black cartridge. It is possible to rewire a few traces on the tan cartidge to accecpt four 32K EPROMS and this is what I did.  128K!, an extra 64K for packages, or even Comal programs that can be loaded from the cartridge.
  598.  
  599. I think it can be expanded to use even more EPROM memory.
  600.  
  601. There was also a C128 cartridge available from Unicomal.  It came with a full 128K of ROM.  It provided 40K free and sold for about $200. I think hardly any were sold, although I would like to get one dirt cheap.  The super chip had a 128 package that enabled use of many 128 features from 64 mode including fast mode, the 80 column screen even with graphics, screen dumps, windowing, etc., and use of the extra keys.
  602.  
  603. Power Driver was the last version of the disk loaded C64 Comal. Amazingly it added still more 2.0 like features and 15K of free RAM. It also had a "compiler".  Comal is a three pass run time iterpreter.  Did I forget to mention that Comal is fast?  The "compiler" strips out the code needed only to reproduce the program listing, etc. and binds the program to the runtime module.  A "compiled" program runs just as fast as the normal interpreted program but it makes 26K of free memory
  604. available, for array storage etc., nearly as much as Comal 2.0.  The "compiled" program is much larger but it can executed without having the Comal language, and of course freely distributed. The Power Driver was semi-free.  It came "free" with the purchase of support package and was included on the later Comal Today disks.  I think it is sharware now.
  605.  
  606. It should have been possible to develope a full 2.0 disk loaded version for the C128, but I don't think it was ever done.  There was a disk loaded version developed for the Apple II.
  607.  
  608. I should also mention that Comal uses memory more efficiently than Basic.  Comal reserves space for the high-res screen and packages. There are also "buffer" routines for using additional RAM, almost 8K additional for Power Driver, and 22K additional for Comal 2.0.  Basic 2.0 has 39K available but you have to reduce that to use a high-res screen.  I think GEOS only gives 24K of RAM.
  609.  
  610. One thing I had hoped to find is a true Ramdisk for the CBM REU. Maybe there is even a way to install RAMDOS for use with Comal.  The REU can be used in direct access mode with Comal.  But it would be wonderful to be able to load external procedures, packages, and chain programs from the REU.
  611.  
  612. The comal 2.0 cartridge banks in 16K of code at a time.  The same amount and location that the REU can privide from its vacant socket. I wonder if there is someway to install Comal 2.0 in a modified REU?. Plugging an REU and cartridge into an expander board is a sensitive and fragile arrangement.
  613.  
  614. I think I would have been satisfied with the Power Driver and JiffyDOS If they had been available from the start.  It certainly beats the heck out of Basic.  And Comal 2.0 is very good, too many good features to list here.  I think the best feature was Comal Today and the quality and diversity of the users who supported it.
  615.  
  616. I am not aware of the legal status of Comal.  I expect the stuff is copyrighted but not available from any commercial source.  Of course
  617. anyone is free is develop a new implementation of Comal and market it. I am not aware of any Comal related files archived on the Internet, There may be Comal files on the commercial services and in club libraries.
  618.  
  619. There are many programming languages that the C64 can use.  Comal, Forth, C, Pascal, Basic, Assembly, and others.  On the C128 in CP/M mode there are other good choices.  I believe in the philosophy of using the right language for the right task and programmer.  Comal is often the best answer, but not always.  I think Power C is good for programmers that are comfortable with it.  Assembly language is good, but it is slow to program and requires more skill.  Comal with packages written in Assembly language is an outstanding combination. Somone asked about Fortran on the C64.  I think there are two C64 Fortran packages, but none that I would recommend.  There are some acceptable Fortran compilers that will run on a C128 in CP/M mode, particularly Microsoft Fortran.  There are even Comal programs that will translate source from Basic to Comal, and Comal to Fortran.  Both leave more editing work to be done.
  620.  
  621. -------------------------
  622. Comal..
  623.  
  624. From : Phil Heberer
  625.  
  626. Jerome Warburton writes:
  627.  
  628.  JW>        Just a few guestions about COMAL. Is there a C=128 version? Is the group that was doing the News letter still active? Are there any share ware programs that were written with it that you know of out  there. 
  629.  
  630. There *was* a C-128 COMAL cartridge produced, but it was imported from Denmark, and cost around $180 6-7 years ago! I have a COMAL cartridge that has what was called the "Super Chip" installed in an EPROM slot in the cartridge, and the Super Chip allows access to the 2 MHz speed and the 80 col screen when used on a 128/128D. I also have CP/M COMAL V2.10 that runs on the 128 in CP/M mode quite nicely. 
  631.  
  632. As for Len Sindsay and the COMAL Today newsletter, I'm afraid they are long gone. :( The last issue I got was COMAL Today #24. 
  633.  
  634. There were some shareware/PD things done in COMAL, and I have a few of those. I really think COMAL is a powerful, and easy-to-learn language, and it's a shame it never really caught on in this country. It was quite popular in England and the Scandinavian countries though. 
  635.  
  636.  JW>        I may just have to pull it back out and see if I have better  luck working with it these days. 
  637.  
  638. I *used* to have a COMAL tutorial disk, but I loaned it to a relative newbie to make a copy of, and they formatted the wrong disk. :( As luck would have it, that was probbly the ONE disk I didn't have a backup of. I know a couple of people who have that disk, so I may be able to get a replacement soon. I have all the COMAL Today newsletters, and about every book ever written on it, so I'd be glad to help if I can. 
  639.  
  640. --------------------------
  641.  
  642.  
  643.